<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 2018/9/12
 * Time: 上午10:30
 */

namespace app\admin\controller;


use think\Request;

class Club extends Auth
{
    /**
     * @purpose 改变俱乐部状态
     * @param Request $request
     * @return array
     */
    public function changeStatus (Request $request)
    {
        $status     = $request->post('status', 0);
        $uuid    = $request->post('uuid', '');
        return \app\admin\logic\Club::changeStatus($status, $uuid);
    }
    /**
     * @purpose 获取俱乐部列表
     * @param Request $request
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function items (Request $request)
    {
        $page       = $request->get('page', 1);
        $size       = $request->get('size', 50);
        return \app\admin\logic\Club::items($page,$size);
    }
    /**
     * @purpose 创建俱乐部
     * @param Request $request
     * @return array
     */
    public function add (Request $request)
    {
        $data       = $request->post();
        return \app\admin\logic\Club::create($data);
    }
}